# -*- coding: utf-8 -*- 
#
# Description:
#
#  Definiton
#
#
#
# Changes:
#
# 2012-01-10
# Initial Commit
#
#
# Copyright 2010-2012, WyDev Team.
# Author: Polo35 (polo35580@hotmail.fr)
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

nname: 42
n 42(None)[]:
	i: 23(), 41()
	o: 

nname: 41
n 41(None)[]:
	i: 0&12(f)
	o: 42()

nname: 23
n 23(None)[context['selected'].show_menu()
]:
	i: 0&12(t)
	o: 42()

nname: 0&12
n 0&12('selected' in context and context['selected'])[]:
	i: 
	o: 23(t), 41(f)

nname: 0&12
n 0&12(None)[if 'selected' in context and context['selected']:
	context['selected'].show_menu()
]:
	i: 
	o: 

self.nodes: {'0&12': <unpyclib.structure.node instance at 0xb76c32ec>}
nname: 192
n 192(None)[]:
	i: 0(AL), 191()
	o: 

nname: 191
n 191(None)[]:
	i: 83(AF), 94()
	o: 192()

nname: 94
n 94(None)[for trans in HMI_PHOTO['transitions']:
caption = '%s' % transition_dict.get(trans, trans)
self.actions_dict[trans] = dict(handler=self.transitions, caption=caption, checked=user_config['photo']['transition'] == trans, args=(trans,), kwargs=dict())
]:
	i: 83(for)
	o: 191()

nname: 83
n 83(None)[]:
	i: 0(loop)
	o: 94(for), 191(AF)

nname: 0
n 0(None)[self.item = item
self.actions_dict = dict()
ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)
self.radio = True
from pygui.facilities.codemapping import transition_dict
]:
	i: 
	o: 83(loop), 192(AL)

nname: 192
n 192(None)[]:
	i: 94()
	o: 

nname: 94
n 94(None)[for trans in HMI_PHOTO['transitions']:
	caption = '%s' % transition_dict.get(trans, trans)
	self.actions_dict[trans] = dict(handler=self.transitions, caption=caption, checked=user_config['photo']['transition'] == trans, args=(trans,), kwargs=dict())
]:
	i: 0(for)
	o: 192()

nname: 0
n 0(None)[self.item = item
self.actions_dict = dict()
ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)
self.radio = True
from pygui.facilities.codemapping import transition_dict
]:
	i: 
	o: 94(for)

nname: 192
n 192(None)[]:
	i: 0()
	o: 

nname: 0
n 0(None)[self.item = item
self.actions_dict = dict()
ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)
self.radio = True
from pygui.facilities.codemapping import transition_dict
for trans in HMI_PHOTO['transitions']:
	caption = '%s' % transition_dict.get(trans, trans)
	self.actions_dict[trans] = dict(handler=self.transitions, caption=caption, checked=user_config['photo']['transition'] == trans, args=(trans,), kwargs=dict())
]:
	i: 
	o: 192()

nname: 0
n 0(None)[self.item = item
self.actions_dict = dict()
ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)
self.radio = True
from pygui.facilities.codemapping import transition_dict
for trans in HMI_PHOTO['transitions']:
	caption = '%s' % transition_dict.get(trans, trans)
	self.actions_dict[trans] = dict(handler=self.transitions, caption=caption, checked=user_config['photo']['transition'] == trans, args=(trans,), kwargs=dict())
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76c3f4c>}
nname: 0
n 0(None)[self._update_checked(trans)
user_config['photo']['transition'] = trans
user_config.save()
self.menu._set_options_list(keep_selection=True)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76c3bcc>}
nname: 6
n 6(None)[def __init__(self, item, menu, name, **kw):
	self.item = item
	self.actions_dict = dict()
	ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)
	self.radio = True
	from pygui.facilities.codemapping import transition_dict
	for trans in HMI_PHOTO['transitions']:
		caption = '%s' % transition_dict.get(trans, trans)
		self.actions_dict[trans] = dict(handler=self.transitions, caption=caption, checked=user_config['photo']['transition'] == trans, args=(trans,), kwargs=dict())

def transitions(self, trans):
	self._update_checked(trans)
	user_config['photo']['transition'] = trans
	user_config.save()
	self.menu._set_options_list(keep_selection=True)

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb76bcfec>}
nname: 0
n 0(None)[return []
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76bcdec>}
nname: 0
n 0(None)[]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76bce4c>}
nname: 0
n 0(None)[self.player = menu
current_ratio = menu.aspect_ratio
self.actions_dict = {'4_3': {'handler': self.set_aspect_ratio, 'caption': _('4:3'), 'checked': current_ratio == '4_3', 'args': ('4_3',), 'kwargs': {}}, '16_9': {'handler': self.set_aspect_ratio, 'caption': _('16:9'), 'checked': current_ratio == '16_9', 'args': ('16_9',), 'kwargs': {}}}
self.radio = True
ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76c550c>}
nname: 0
n 0(None)[self._update_checked(aspect_ratio)
self.player.aspect_ratio = aspect_ratio
self.menu._set_options_list(keep_selection=True)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76c384c>}
nname: 6
n 6(None)[__doc__ = "Used to set the user's TV's aspect ratio (is it 4:3 or 16:9?).\n\n    Note that this is a player setting, not a per-item one.\n    "
def __init__(self, menu, name, **kw):
	self.player = menu
	current_ratio = menu.aspect_ratio
	self.actions_dict = {'4_3': {'handler': self.set_aspect_ratio, 'caption': _('4:3'), 'checked': current_ratio == '4_3', 'args': ('4_3',), 'kwargs': {}}, '16_9': {'handler': self.set_aspect_ratio, 'caption': _('16:9'), 'checked': current_ratio == '16_9', 'args': ('16_9',), 'kwargs': {}}}
	self.radio = True
	ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)

def set_aspect_ratio(self, aspect_ratio):
	self._update_checked(aspect_ratio)
	self.player.aspect_ratio = aspect_ratio
	self.menu._set_options_list(keep_selection=True)

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb76bcf6c>}
nname: 171
n 171(None)[self.actions_dict = actions_dict
self.radio = True
ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)
]:
	i: 0(AL), 170()
	o: 

nname: 170
n 170(None)[]:
	i: 78(AF), 85()
	o: 171()

nname: 85
n 85(None)[for key, caption in values:
action = {'handler': self.set_display_format, 'caption': caption, 'checked': current_format == key, 'args': (key,), 'kwargs': {}}
actions_dict[key] = action
]:
	i: 78(for)
	o: 170()

nname: 78
n 78(None)[]:
	i: 0(loop)
	o: 85(for), 170(AF)

nname: 0
n 0(None)[self.player = menu
current_format = menu.display_format
values = [('letter_box', _('Original')), ('pan_scan', _('Full screen')), ('fullscreen', _('Cinema'))]
actions_dict = {}
]:
	i: 
	o: 78(loop), 171(AL)

nname: 171
n 171(None)[self.actions_dict = actions_dict
self.radio = True
ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)
]:
	i: 85()
	o: 

nname: 85
n 85(None)[for key, caption in values:
	action = {'handler': self.set_display_format, 'caption': caption, 'checked': current_format == key, 'args': (key,), 'kwargs': {}}
	actions_dict[key] = action
]:
	i: 0(for)
	o: 171()

nname: 0
n 0(None)[self.player = menu
current_format = menu.display_format
values = [('letter_box', _('Original')), ('pan_scan', _('Full screen')), ('fullscreen', _('Cinema'))]
actions_dict = {}
]:
	i: 
	o: 85(for)

nname: 171
n 171(None)[self.actions_dict = actions_dict
self.radio = True
ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)
]:
	i: 0()
	o: 

nname: 0
n 0(None)[self.player = menu
current_format = menu.display_format
values = [('letter_box', _('Original')), ('pan_scan', _('Full screen')), ('fullscreen', _('Cinema'))]
actions_dict = {}
for key, caption in values:
	action = {'handler': self.set_display_format, 'caption': caption, 'checked': current_format == key, 'args': (key,), 'kwargs': {}}
	actions_dict[key] = action
]:
	i: 
	o: 171()

nname: 0
n 0(None)[self.player = menu
current_format = menu.display_format
values = [('letter_box', _('Original')), ('pan_scan', _('Full screen')), ('fullscreen', _('Cinema'))]
actions_dict = {}
for key, caption in values:
	action = {'handler': self.set_display_format, 'caption': caption, 'checked': current_format == key, 'args': (key,), 'kwargs': {}}
	actions_dict[key] = action
self.actions_dict = actions_dict
self.radio = True
ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76c550c>}
nname: 0
n 0(None)[self._update_checked(display_format)
self.player.display_format, user_config['video']['display_format'] = display_format, display_format
user_config.save()
self.menu._set_options_list(keep_selection=True)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76c3d4c>}
nname: 6
n 6(None)[__doc__ = "Used to set the display format when the TV's aspect ratio does not\n    match that of the video stream (e.g. 16:9 video on a 4:3 display).\n\n    See http://wiki.wyplay.int/doku.php/wybox:soft:multimedia:output_control\n    for a definition of what each setting does depending on the currently-\n    selected aspect ratio.\n    "
def __init__(self, menu, name, **kw):
	self.player = menu
	current_format = menu.display_format
	values = [('letter_box', _('Original')), ('pan_scan', _('Full screen')), ('fullscreen', _('Cinema'))]
	actions_dict = {}
	for key, caption in values:
		action = {'handler': self.set_display_format, 'caption': caption, 'checked': current_format == key, 'args': (key,), 'kwargs': {}}
		actions_dict[key] = action
	self.actions_dict = actions_dict
	self.radio = True
	ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)

def set_display_format(self, display_format):
	self._update_checked(display_format)
	self.player.display_format, user_config['video']['display_format'] = display_format, display_format
	user_config.save()
	self.menu._set_options_list(keep_selection=True)

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb76bcf4c>}
nname: 327
n 327(None)[]:
	i: 0(AL), 326()
	o: 

nname: 326
n 326(None)[]:
	i: 73(AF), 238()
	o: 327()

nname: 238
n 238(None)[sid = sub[2]
self.actions_dict[sid] = dict(handler=self.subtitles, caption=caption, checked=sub[1], args=(self.menu, sid), kwargs=dict(), pos=sid + 1)
]:
	i: 165(), 219(), 236(AE)
	o: 326()

nname: 236
n 236(None)[]:
	i: 209(f)
	o: 238(AE)

nname: 219
n 219(None)[lang_dict[caption] = 2
]:
	i: 209(t)
	o: 238()

nname: 209
n 209(<dummy_ex3> EXC_MATCH KeyError)[]:
	i: 162(except)
	o: 219(t), 236(f)

nname: 165
n 165(None)[nb = lang_dict[caption]
lang_dict[caption] = nb + 1
caption = '%s-%.2d' % (caption, nb)
]:
	i: 162(try)
	o: 238()

nname: 162
n 162(None)[]:
	i: 95(), 137(), 160(AE)
	o: 165(try), 209(except)

nname: 160
n 160(None)[]:
	i: 127(f)
	o: 162(AE)

nname: 137
n 137(None)[caption = _(sub[0])
]:
	i: 127(t)
	o: 162()

nname: 127
n 127(<dummy_ex3> EXC_MATCH KeyError)[]:
	i: 89(except)
	o: 137(t), 160(f)

nname: 95
n 95(None)[caption = _(country_dict[sub[0][:2]]['language'])
]:
	i: 89(try)
	o: 162()

nname: 89
n 89(None)[for sub in self.menu.get_subtitles():
]:
	i: 73(for)
	o: 95(try), 127(except)

nname: 73
n 73(None)[]:
	i: 0(loop)
	o: 89(for), 326(AF)

nname: 0
n 0(None)[self.item = item
self.actions_dict = dict()
ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)
self.radio = True
lang_dict = {}
]:
	i: 
	o: 73(loop), 327(AL)

nname: 327
n 327(None)[]:
	i: 0(AL), 73(AF), 238()
	o: 

nname: 238
n 238(None)[sid = sub[2]
self.actions_dict[sid] = dict(handler=self.subtitles, caption=caption, checked=sub[1], args=(self.menu, sid), kwargs=dict(), pos=sid + 1)
]:
	i: 165()
	o: 327()

nname: 165
n 165(None)[try:
	nb = lang_dict[caption]
	lang_dict[caption] = nb + 1
	caption = '%s-%.2d' % (caption, nb)
except KeyError:
	lang_dict[caption] = 2
]:
	i: 127(try)
	o: 238()

nname: 127
n 127(None)[except KeyError:
	caption = _(sub[0])
]:
	i: 89()
	o: 165(try)

nname: 89
n 89(None)[for sub in self.menu.get_subtitles():
try:
	caption = _(country_dict[sub[0][:2]]['language'])
]:
	i: 73(for)
	o: 127()

nname: 73
n 73(None)[]:
	i: 0(loop)
	o: 89(for), 327(AF)

nname: 0
n 0(None)[self.item = item
self.actions_dict = dict()
ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)
self.radio = True
lang_dict = {}
]:
	i: 
	o: 73(loop), 327(AL)

nname: 327
n 327(None)[]:
	i: 0(AL), 73(AF), 165()
	o: 

nname: 165
n 165(None)[try:
	nb = lang_dict[caption]
	lang_dict[caption] = nb + 1
	caption = '%s-%.2d' % (caption, nb)
except KeyError:
	lang_dict[caption] = 2
sid = sub[2]
self.actions_dict[sid] = dict(handler=self.subtitles, caption=caption, checked=sub[1], args=(self.menu, sid), kwargs=dict(), pos=sid + 1)
]:
	i: 89(try)
	o: 327()

nname: 89
n 89(None)[for sub in self.menu.get_subtitles():
try:
	caption = _(country_dict[sub[0][:2]]['language'])
except KeyError:
	caption = _(sub[0])
]:
	i: 73(for)
	o: 165(try)

nname: 73
n 73(None)[]:
	i: 0(loop)
	o: 89(for), 327(AF)

nname: 0
n 0(None)[self.item = item
self.actions_dict = dict()
ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)
self.radio = True
lang_dict = {}
]:
	i: 
	o: 73(loop), 327(AL)

nname: 327
n 327(None)[]:
	i: 0(AL), 73(AF), 89()
	o: 

nname: 89
n 89(None)[for sub in self.menu.get_subtitles():
try:
	caption = _(country_dict[sub[0][:2]]['language'])
except KeyError:
	caption = _(sub[0])
try:
	nb = lang_dict[caption]
	lang_dict[caption] = nb + 1
	caption = '%s-%.2d' % (caption, nb)
except KeyError:
	lang_dict[caption] = 2
sid = sub[2]
self.actions_dict[sid] = dict(handler=self.subtitles, caption=caption, checked=sub[1], args=(self.menu, sid), kwargs=dict(), pos=sid + 1)
]:
	i: 73(for)
	o: 327()

nname: 73
n 73(None)[]:
	i: 0(loop)
	o: 89(for), 327(AF)

nname: 0
n 0(None)[self.item = item
self.actions_dict = dict()
ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)
self.radio = True
lang_dict = {}
]:
	i: 
	o: 73(loop), 327(AL)

nname: 89
n 89(None)[for sub in self.menu.get_subtitles():
	try:
		caption = _(country_dict[sub[0][:2]]['language'])
	except KeyError:
		caption = _(sub[0])
	try:
		nb = lang_dict[caption]
		lang_dict[caption] = nb + 1
		caption = '%s-%.2d' % (caption, nb)
	except KeyError:
		lang_dict[caption] = 2
	sid = sub[2]
	self.actions_dict[sid] = dict(handler=self.subtitles, caption=caption, checked=sub[1], args=(self.menu, sid), kwargs=dict(), pos=sid + 1)
]:
	i: 0(for)
	o: 

nname: 0
n 0(None)[self.item = item
self.actions_dict = dict()
ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)
self.radio = True
lang_dict = {}
]:
	i: 
	o: 89(for)

nname: 0
n 0(None)[self.item = item
self.actions_dict = dict()
ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)
self.radio = True
lang_dict = {}
for sub in self.menu.get_subtitles():
	try:
		caption = _(country_dict[sub[0][:2]]['language'])
	except KeyError:
		caption = _(sub[0])
	try:
		nb = lang_dict[caption]
		lang_dict[caption] = nb + 1
		caption = '%s-%.2d' % (caption, nb)
	except KeyError:
		lang_dict[caption] = 2
	sid = sub[2]
	self.actions_dict[sid] = dict(handler=self.subtitles, caption=caption, checked=sub[1], args=(self.menu, sid), kwargs=dict(), pos=sid + 1)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76c5bcc>}
nname: 0
n 0(None)[self._update_checked(sid)
player.set_subtitle(sid)
self.menu._set_options_list(keep_selection=True)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76c3a4c>}
nname: 6
n 6(None)[def __init__(self, item, menu, name, **kw):
	self.item = item
	self.actions_dict = dict()
	ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)
	self.radio = True
	lang_dict = {}
	for sub in self.menu.get_subtitles():
		try:
			caption = _(country_dict[sub[0][:2]]['language'])
		except KeyError:
			caption = _(sub[0])
		try:
			nb = lang_dict[caption]
			lang_dict[caption] = nb + 1
			caption = '%s-%.2d' % (caption, nb)
		except KeyError:
			lang_dict[caption] = 2
		sid = sub[2]
		self.actions_dict[sid] = dict(handler=self.subtitles, caption=caption, checked=sub[1], args=(self.menu, sid), kwargs=dict(), pos=sid + 1)

def subtitles(self, player, sid):
	self._update_checked(sid)
	player.set_subtitle(sid)
	self.menu._set_options_list(keep_selection=True)

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb76bcf2c>}
nname: 386
n 386(None)[]:
	i: 0(AL), 385()
	o: 

nname: 385
n 385(None)[]:
	i: 73(AF), 301()
	o: 386()

nname: 301
n 301(None)[sid = sub[2]
self.actions_dict[sid] = dict(handler=self.substreams, caption=caption, checked=sub[1], pos=i, args=(self.menu, sid), kwargs=dict())
]:
	i: 282(), 300()
	o: 385()

nname: 300
n 300(None)[]:
	i: 244(f)
	o: 301()

nname: 282
n 282(None)[caption += '-%d' % num
]:
	i: 244(t)
	o: 301()

nname: 244
n 244(num)[num = lang_dict.get(caption, 0)
lang_dict[caption] = num + 1
]:
	i: 205(), 243()
	o: 282(t), 300(f)

nname: 243
n 243(None)[]:
	i: 170&188(f)
	o: 244()

nname: 205
n 205(None)[caption += '-' + audio_codec_substitution_dict.get(sub[3], sub[3])
]:
	i: 170&188(t)
	o: 244()

nname: 170&188
n 170&188(len(sub) > 3 and sub[3] not in ('mp2',))[]:
	i: 117(), 155(), 168(AE)
	o: 205(t), 243(f)

nname: 168
n 168(None)[]:
	i: 145(f)
	o: 170&188(AE)

nname: 155
n 155(None)[caption = lang
]:
	i: 145(t)
	o: 170&188()

nname: 145
n 145(<dummy_ex3> EXC_MATCH KeyError)[]:
	i: 95(except)
	o: 155(t), 168(f)

nname: 117
n 117(None)[caption = _(country_dict[lang[:2]]['language'])
]:
	i: 95(try)
	o: 170&188()

nname: 95
n 95(None)[for i, sub in enumerate(self.menu.get_audio_substreams()):
lang = sub[0]
]:
	i: 73(for)
	o: 117(try), 145(except)

nname: 73
n 73(None)[]:
	i: 0(loop)
	o: 95(for), 385(AF)

nname: 0
n 0(None)[self.item = item
self.actions_dict = dict()
ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)
self.radio = True
lang_dict = {}
]:
	i: 
	o: 73(loop), 386(AL)

nname: 386
n 386(None)[]:
	i: 0(AL), 73(AF), 244()
	o: 

nname: 244
n 244(None)[num = lang_dict.get(caption, 0)
lang_dict[caption] = num + 1
if num:
	caption += '-%d' % num
sid = sub[2]
self.actions_dict[sid] = dict(handler=self.substreams, caption=caption, checked=sub[1], pos=i, args=(self.menu, sid), kwargs=dict())
]:
	i: 145()
	o: 386()

nname: 145
n 145(None)[except KeyError:
	caption = lang
if len(sub) > 3 and sub[3] not in ('mp2',):
	caption += '-' + audio_codec_substitution_dict.get(sub[3], sub[3])
]:
	i: 95()
	o: 244()

nname: 95
n 95(None)[for i, sub in enumerate(self.menu.get_audio_substreams()):
lang = sub[0]
try:
	caption = _(country_dict[lang[:2]]['language'])
]:
	i: 73(for)
	o: 145()

nname: 73
n 73(None)[]:
	i: 0(loop)
	o: 95(for), 386(AF)

nname: 0
n 0(None)[self.item = item
self.actions_dict = dict()
ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)
self.radio = True
lang_dict = {}
]:
	i: 
	o: 73(loop), 386(AL)

nname: 386
n 386(None)[]:
	i: 0(AL), 73(AF), 244()
	o: 

nname: 244
n 244(None)[num = lang_dict.get(caption, 0)
lang_dict[caption] = num + 1
if num:
	caption += '-%d' % num
sid = sub[2]
self.actions_dict[sid] = dict(handler=self.substreams, caption=caption, checked=sub[1], pos=i, args=(self.menu, sid), kwargs=dict())
]:
	i: 95()
	o: 386()

nname: 95
n 95(None)[for i, sub in enumerate(self.menu.get_audio_substreams()):
lang = sub[0]
try:
	caption = _(country_dict[lang[:2]]['language'])
except KeyError:
	caption = lang
if len(sub) > 3 and sub[3] not in ('mp2',):
	caption += '-' + audio_codec_substitution_dict.get(sub[3], sub[3])
]:
	i: 73(for)
	o: 244()

nname: 73
n 73(None)[]:
	i: 0(loop)
	o: 95(for), 386(AF)

nname: 0
n 0(None)[self.item = item
self.actions_dict = dict()
ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)
self.radio = True
lang_dict = {}
]:
	i: 
	o: 73(loop), 386(AL)

nname: 386
n 386(None)[]:
	i: 0(AL), 73(AF), 95()
	o: 

nname: 95
n 95(None)[for i, sub in enumerate(self.menu.get_audio_substreams()):
lang = sub[0]
try:
	caption = _(country_dict[lang[:2]]['language'])
except KeyError:
	caption = lang
if len(sub) > 3 and sub[3] not in ('mp2',):
	caption += '-' + audio_codec_substitution_dict.get(sub[3], sub[3])
num = lang_dict.get(caption, 0)
lang_dict[caption] = num + 1
if num:
	caption += '-%d' % num
sid = sub[2]
self.actions_dict[sid] = dict(handler=self.substreams, caption=caption, checked=sub[1], pos=i, args=(self.menu, sid), kwargs=dict())
]:
	i: 73(for)
	o: 386()

nname: 73
n 73(None)[]:
	i: 0(loop)
	o: 95(for), 386(AF)

nname: 0
n 0(None)[self.item = item
self.actions_dict = dict()
ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)
self.radio = True
lang_dict = {}
]:
	i: 
	o: 73(loop), 386(AL)

nname: 95
n 95(None)[for i, sub in enumerate(self.menu.get_audio_substreams()):
	lang = sub[0]
	try:
		caption = _(country_dict[lang[:2]]['language'])
	except KeyError:
		caption = lang
	if len(sub) > 3 and sub[3] not in ('mp2',):
		caption += '-' + audio_codec_substitution_dict.get(sub[3], sub[3])
	num = lang_dict.get(caption, 0)
	lang_dict[caption] = num + 1
	if num:
		caption += '-%d' % num
	sid = sub[2]
	self.actions_dict[sid] = dict(handler=self.substreams, caption=caption, checked=sub[1], pos=i, args=(self.menu, sid), kwargs=dict())
]:
	i: 0(for)
	o: 

nname: 0
n 0(None)[self.item = item
self.actions_dict = dict()
ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)
self.radio = True
lang_dict = {}
]:
	i: 
	o: 95(for)

nname: 0
n 0(None)[self.item = item
self.actions_dict = dict()
ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)
self.radio = True
lang_dict = {}
for i, sub in enumerate(self.menu.get_audio_substreams()):
	lang = sub[0]
	try:
		caption = _(country_dict[lang[:2]]['language'])
	except KeyError:
		caption = lang
	if len(sub) > 3 and sub[3] not in ('mp2',):
		caption += '-' + audio_codec_substitution_dict.get(sub[3], sub[3])
	num = lang_dict.get(caption, 0)
	lang_dict[caption] = num + 1
	if num:
		caption += '-%d' % num
	sid = sub[2]
	self.actions_dict[sid] = dict(handler=self.substreams, caption=caption, checked=sub[1], pos=i, args=(self.menu, sid), kwargs=dict())
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76d414c>}
nname: 0
n 0(None)[self._update_checked(sid)
player.set_audio_substream(sid)
self.menu._set_options_list(keep_selection=True)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76c3a4c>}
nname: 6
n 6(None)[def __init__(self, item, menu, name, **kw):
	self.item = item
	self.actions_dict = dict()
	ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)
	self.radio = True
	lang_dict = {}
	for i, sub in enumerate(self.menu.get_audio_substreams()):
		lang = sub[0]
		try:
			caption = _(country_dict[lang[:2]]['language'])
		except KeyError:
			caption = lang
		if len(sub) > 3 and sub[3] not in ('mp2',):
			caption += '-' + audio_codec_substitution_dict.get(sub[3], sub[3])
		num = lang_dict.get(caption, 0)
		lang_dict[caption] = num + 1
		if num:
			caption += '-%d' % num
		sid = sub[2]
		self.actions_dict[sid] = dict(handler=self.substreams, caption=caption, checked=sub[1], pos=i, args=(self.menu, sid), kwargs=dict())

def substreams(self, player, sid):
	self._update_checked(sid)
	player.set_audio_substream(sid)
	self.menu._set_options_list(keep_selection=True)

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb76bce0c>}
nname: 0
n 0(None)[player = context['menu']
return player.get_audio_substreams()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76bce6c>}
nname: 0
n 0(None)[player.set_audio_substream(aid)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76bcecc>}
nname: 23
n 23(None)[player.repeat_mode = mode
]:
	i: 12(), 19()
	o: 

nname: 19
n 19(None)[]:
	i: 0(f)
	o: 23()

nname: 12
n 12(None)[]:
	i: 0(t)
	o: 23()

nname: 0
n 0(mode == 'off')[]:
	i: 
	o: 12(t), 19(f)

nname: 0
n 0(None)[if mode == 'off':
	pass
player.repeat_mode = mode
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76bcfac>}
nname: 0
n 0(None)[player.go_random()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76bce8c>}
nname: 145
n 145(None)[self.actions_dict = {'off': {'handler': self.set_repeat, 'caption': _('OFF'), 'checked': sel[0], 'args': ('off',), 'kwargs': {}, 'pos': 1}, 'track': {'handler': self.set_repeat, 'caption': _('Track'), 'checked': sel[1], 'args': ('track',), 'kwargs': {}, 'pos': 2}, 'all': {'handler': self.set_repeat, 'caption': _('All'), 'checked': sel[2], 'args': ('all',), 'kwargs': {}, 'pos': 3}}
]:
	i: 49(), 87(), 125(), 144()
	o: 

nname: 144
n 144(None)[]:
	i: 106(f)
	o: 145()

nname: 125
n 125(None)[sel = (False, False, True)
]:
	i: 106(t)
	o: 145()

nname: 106
n 106(self.player.repeat_mode == 'all')[]:
	i: 68(f)
	o: 125(t), 144(f)

nname: 87
n 87(None)[sel = (False, True, False)
]:
	i: 68(t)
	o: 145()

nname: 68
n 68(self.player.repeat_mode == 'track')[]:
	i: 0(t)
	o: 87(t), 106(f)

nname: 49
n 49(None)[sel = (True, False, False)
]:
	i: 0(f)
	o: 145()

nname: 0
n 0(self.player.repeat_mode)[ActionContainer.__init__(self, *args, **kw)
self.player = player
self.radio = True
]:
	i: 
	o: 49(f), 68(t)

nname: 0
n 0(None)[ActionContainer.__init__(self, *args, **kw)
self.player = player
self.radio = True
if not self.player.repeat_mode:
	sel = (True, False, False)
else:
	if self.player.repeat_mode == 'track':
		sel = (False, True, False)
	else:
		if self.player.repeat_mode == 'all':
			sel = (False, False, True)
self.actions_dict = {'off': {'handler': self.set_repeat, 'caption': _('OFF'), 'checked': sel[0], 'args': ('off',), 'kwargs': {}, 'pos': 1}, 'track': {'handler': self.set_repeat, 'caption': _('Track'), 'checked': sel[1], 'args': ('track',), 'kwargs': {}, 'pos': 2}, 'all': {'handler': self.set_repeat, 'caption': _('All'), 'checked': sel[2], 'args': ('all',), 'kwargs': {}, 'pos': 3}}
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76cc1ac>}
nname: 0
n 0(None)[set_repeat_mode(self.player, mode)
self._update_checked(mode)
self.menu._set_options_list(keep_selection=True)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76c376c>}
nname: 6
n 6(None)[def __init__(self, player, *args, **args):
	ActionContainer.__init__(self, *args, **kw)
	self.player = player
	self.radio = True
	if not self.player.repeat_mode:
		sel = (True, False, False)
	else:
		if self.player.repeat_mode == 'track':
			sel = (False, True, False)
		else:
			if self.player.repeat_mode == 'all':
				sel = (False, False, True)
	self.actions_dict = {'off': {'handler': self.set_repeat, 'caption': _('OFF'), 'checked': sel[0], 'args': ('off',), 'kwargs': {}, 'pos': 1}, 'track': {'handler': self.set_repeat, 'caption': _('Track'), 'checked': sel[1], 'args': ('track',), 'kwargs': {}, 'pos': 2}, 'all': {'handler': self.set_repeat, 'caption': _('All'), 'checked': sel[2], 'args': ('all',), 'kwargs': {}, 'pos': 3}}

def set_repeat(self, mode):
	set_repeat_mode(self.player, mode)
	self._update_checked(mode)
	self.menu._set_options_list(keep_selection=True)

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb76bcd8c>}
nname: 72
n 72(None)[sel = (True, False)
self.actions_dict = {'off': {'handler': self.set_random, 'caption': _('OFF'), 'checked': sel[0], 'args': ('off',), 'kwargs': {}, 'pos': 1}, 'on': {'handler': self.set_random, 'caption': _('ON'), 'checked': sel[1], 'args': ('on',), 'kwargs': {}, 'pos': 2}}
]:
	i: 49(), 62()
	o: 

nname: 62
n 62(None)[]:
	i: 0(f)
	o: 72()

nname: 49
n 49(None)[]:
	i: 0(t)
	o: 72()

nname: 0
n 0(self.player.random_mode)[ActionContainer.__init__(self, *args, **kw)
self.radio = True
self.player = player
]:
	i: 
	o: 49(t), 62(f)

nname: 0
n 0(None)[ActionContainer.__init__(self, *args, **kw)
self.radio = True
self.player = player
if self.player.random_mode:
	pass
sel = (True, False)
self.actions_dict = {'off': {'handler': self.set_random, 'caption': _('OFF'), 'checked': sel[0], 'args': ('off',), 'kwargs': {}, 'pos': 1}, 'on': {'handler': self.set_random, 'caption': _('ON'), 'checked': sel[1], 'args': ('on',), 'kwargs': {}, 'pos': 2}}
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76cc98c>}
nname: 0
n 0(None)[set_random_mode(self.player, mode)
self._update_checked(mode)
self.menu._set_options_list(keep_selection=True)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76c380c>}
nname: 6
n 6(None)[def __init__(self, player, *args, **args):
	ActionContainer.__init__(self, *args, **kw)
	self.radio = True
	self.player = player
	if self.player.random_mode:
		pass
	sel = (True, False)
	self.actions_dict = {'off': {'handler': self.set_random, 'caption': _('OFF'), 'checked': sel[0], 'args': ('off',), 'kwargs': {}, 'pos': 1}, 'on': {'handler': self.set_random, 'caption': _('ON'), 'checked': sel[1], 'args': ('on',), 'kwargs': {}, 'pos': 2}}

def set_random(self, mode):
	set_random_mode(self.player, mode)
	self._update_checked(mode)
	self.menu._set_options_list(keep_selection=True)

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb76bceac>}
nname: 0
n 0(None)[RepeatAudioActionItem.__init__(self, player, *args, **kw)
self.actions_dict.pop('track')
self.actions_dict.pop('all')
_is_not_repeat = self.actions_dict['off']['checked']
self.actions_dict['on'] = {'handler': self.set_repeat, 'caption': _('ON'), 'checked': not _is_not_repeat, 'args': ('dummy',), 'kwargs': {}, 'pos': 2}
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76c3d2c>}
nname: 71
n 71(None)[key = mode
self._update_checked(key)
self.menu._set_options_list(keep_selection=True)
]:
	i: 60(), 67()
	o: 

nname: 67
n 67(None)[]:
	i: 29(f)
	o: 71()

nname: 60
n 60(None)[]:
	i: 29(t)
	o: 71()

nname: 29
n 29(mode == 'dummy')[_mode = mode
set_repeat_mode(self.player, _mode)
]:
	i: 12(), 25()
	o: 60(t), 67(f)

nname: 25
n 25(None)[]:
	i: 0(f)
	o: 29()

nname: 12
n 12(None)[]:
	i: 0(t)
	o: 29()

nname: 0
n 0(mode != 'off')[]:
	i: 
	o: 12(t), 25(f)

nname: 71
n 71(None)[key = mode
self._update_checked(key)
self.menu._set_options_list(keep_selection=True)
]:
	i: 0()
	o: 

nname: 0
n 0(None)[if mode != 'off':
	pass
_mode = mode
set_repeat_mode(self.player, _mode)
if mode == 'dummy':
	pass
]:
	i: 
	o: 71()

nname: 0
n 0(None)[if mode != 'off':
	pass
_mode = mode
set_repeat_mode(self.player, _mode)
if mode == 'dummy':
	pass
key = mode
self._update_checked(key)
self.menu._set_options_list(keep_selection=True)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76c3f0c>}
nname: 6
n 6(None)[def __init__(self, player, *args, **args):
	RepeatAudioActionItem.__init__(self, player, *args, **kw)
	self.actions_dict.pop('track')
	self.actions_dict.pop('all')
	_is_not_repeat = self.actions_dict['off']['checked']
	self.actions_dict['on'] = {'handler': self.set_repeat, 'caption': _('ON'), 'checked': not _is_not_repeat, 'args': ('dummy',), 'kwargs': {}, 'pos': 2}

def set_repeat(self, mode):
	if mode != 'off':
		pass
	_mode = mode
	set_repeat_mode(self.player, _mode)
	if mode == 'dummy':
		pass
	key = mode
	self._update_checked(key)
	self.menu._set_options_list(keep_selection=True)

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb76bcfcc>}
nname: 78
n 78(None)[sel = (False, True)
self.actions_dict = {'track': {'handler': self.set_play_mode, 'caption': _('One'), 'checked': sel[0], 'args': ('track',), 'kwargs': {}, 'pos': 1}, 'all': {'handler': self.set_play_mode, 'caption': _('List'), 'checked': sel[1], 'args': ('all',), 'kwargs': {}, 'pos': 2}}
]:
	i: 55(), 68()
	o: 

nname: 68
n 68(None)[]:
	i: 0(f)
	o: 78()

nname: 55
n 55(None)[]:
	i: 0(t)
	o: 78()

nname: 0
n 0(self.player.playmode == 'track')[ActionContainer.__init__(self, *args, **kw)
self.player = player
self.radio = True
]:
	i: 
	o: 55(t), 68(f)

nname: 0
n 0(None)[ActionContainer.__init__(self, *args, **kw)
self.player = player
self.radio = True
if self.player.playmode == 'track':
	pass
sel = (False, True)
self.actions_dict = {'track': {'handler': self.set_play_mode, 'caption': _('One'), 'checked': sel[0], 'args': ('track',), 'kwargs': {}, 'pos': 1}, 'all': {'handler': self.set_play_mode, 'caption': _('List'), 'checked': sel[1], 'args': ('all',), 'kwargs': {}, 'pos': 2}}
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76ccfcc>}
nname: 29
n 29(None)[set_play_mode(self.player, mode)
self._update_checked(mode)
self.menu._set_options_list(keep_selection=True)
]:
	i: 12(), 28()
	o: 

nname: 28
n 28(None)[]:
	i: 0(f)
	o: 29()

nname: 12
n 12(None)[self.player.repeat_mode = mode
]:
	i: 0(t)
	o: 29()

nname: 0
n 0(self.player.repeat_mode)[]:
	i: 
	o: 12(t), 28(f)

nname: 0
n 0(None)[if self.player.repeat_mode:
	self.player.repeat_mode = mode
set_play_mode(self.player, mode)
self._update_checked(mode)
self.menu._set_options_list(keep_selection=True)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76c36cc>}
nname: 6
n 6(None)[def __init__(self, player, *args, **args):
	ActionContainer.__init__(self, *args, **kw)
	self.player = player
	self.radio = True
	if self.player.playmode == 'track':
		pass
	sel = (False, True)
	self.actions_dict = {'track': {'handler': self.set_play_mode, 'caption': _('One'), 'checked': sel[0], 'args': ('track',), 'kwargs': {}, 'pos': 1}, 'all': {'handler': self.set_play_mode, 'caption': _('List'), 'checked': sel[1], 'args': ('all',), 'kwargs': {}, 'pos': 2}}

def set_play_mode(self, mode):
	if self.player.repeat_mode:
		self.player.repeat_mode = mode
	set_play_mode(self.player, mode)
	self._update_checked(mode)
	self.menu._set_options_list(keep_selection=True)

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb76bce0c>}
nname: 0
n 0(None)[player.playmode = mode
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76bccac>}
nname: 0
n 0(None)[context['selected'].play_embedded_audio()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76bcf6c>}
nname: 0
n 0(None)[context['selected'].play_embedded_video()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76bcf2c>}
nname: 0
n 0(None)[context['selected'].play_embedded_image()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76bce0c>}
nname: 0
n 0(None)[from __future__ import absolute_import
from pygui.config import HMI_PHOTO, user_config
from pygui.facilities.codemapping import country_dict, audio_codec_substitution_dict
from pygui.item.containers import ActionContainer
def go_aspect(context, display, aspect_corrected_mode):
	if 'selected' in context and context['selected']:
		context['selected'].show_menu()

class TransitionsActionItem(ActionContainer):
	def __init__(self, item, menu, name, **kw):
		self.item = item
		self.actions_dict = dict()
		ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)
		self.radio = True
		from pygui.facilities.codemapping import transition_dict
		for trans in HMI_PHOTO['transitions']:
			caption = '%s' % transition_dict.get(trans, trans)
			self.actions_dict[trans] = dict(handler=self.transitions, caption=caption, checked=user_config['photo']['transition'] == trans, args=(trans,), kwargs=dict())

	def transitions(self, trans):
		self._update_checked(trans)
		user_config['photo']['transition'] = trans
		user_config.save()
		self.menu._set_options_list(keep_selection=True)



def get_travelling(context):
	return []

def set_travelling(key, value):
	pass

class AspectRatioActionItem(ActionContainer):
	__doc__ = "Used to set the user's TV's aspect ratio (is it 4:3 or 16:9?).\n\n    Note that this is a player setting, not a per-item one.\n    "
	def __init__(self, menu, name, **kw):
		self.player = menu
		current_ratio = menu.aspect_ratio
		self.actions_dict = {'4_3': {'handler': self.set_aspect_ratio, 'caption': _('4:3'), 'checked': current_ratio == '4_3', 'args': ('4_3',), 'kwargs': {}}, '16_9': {'handler': self.set_aspect_ratio, 'caption': _('16:9'), 'checked': current_ratio == '16_9', 'args': ('16_9',), 'kwargs': {}}}
		self.radio = True
		ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)

	def set_aspect_ratio(self, aspect_ratio):
		self._update_checked(aspect_ratio)
		self.player.aspect_ratio = aspect_ratio
		self.menu._set_options_list(keep_selection=True)



class DisplayFormatActionItem(ActionContainer):
	__doc__ = "Used to set the display format when the TV's aspect ratio does not\n    match that of the video stream (e.g. 16:9 video on a 4:3 display).\n\n    See http://wiki.wyplay.int/doku.php/wybox:soft:multimedia:output_control\n    for a definition of what each setting does depending on the currently-\n    selected aspect ratio.\n    "
	def __init__(self, menu, name, **kw):
		self.player = menu
		current_format = menu.display_format
		values = [('letter_box', _('Original')), ('pan_scan', _('Full screen')), ('fullscreen', _('Cinema'))]
		actions_dict = {}
		for key, caption in values:
			action = {'handler': self.set_display_format, 'caption': caption, 'checked': current_format == key, 'args': (key,), 'kwargs': {}}
			actions_dict[key] = action
		self.actions_dict = actions_dict
		self.radio = True
		ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)

	def set_display_format(self, display_format):
		self._update_checked(display_format)
		self.player.display_format, user_config['video']['display_format'] = display_format, display_format
		user_config.save()
		self.menu._set_options_list(keep_selection=True)



class SubtitlesActionItem(ActionContainer):
	def __init__(self, item, menu, name, **kw):
		self.item = item
		self.actions_dict = dict()
		ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)
		self.radio = True
		lang_dict = {}
		for sub in self.menu.get_subtitles():
			try:
				caption = _(country_dict[sub[0][:2]]['language'])
			except KeyError:
				caption = _(sub[0])
			try:
				nb = lang_dict[caption]
				lang_dict[caption] = nb + 1
				caption = '%s-%.2d' % (caption, nb)
			except KeyError:
				lang_dict[caption] = 2
			sid = sub[2]
			self.actions_dict[sid] = dict(handler=self.subtitles, caption=caption, checked=sub[1], args=(self.menu, sid), kwargs=dict(), pos=sid + 1)

	def subtitles(self, player, sid):
		self._update_checked(sid)
		player.set_subtitle(sid)
		self.menu._set_options_list(keep_selection=True)



class AudioSubstreamsActionItem(ActionContainer):
	def __init__(self, item, menu, name, **kw):
		self.item = item
		self.actions_dict = dict()
		ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)
		self.radio = True
		lang_dict = {}
		for i, sub in enumerate(self.menu.get_audio_substreams()):
			lang = sub[0]
			try:
				caption = _(country_dict[lang[:2]]['language'])
			except KeyError:
				caption = lang
			if len(sub) > 3 and sub[3] not in ('mp2',):
				caption += '-' + audio_codec_substitution_dict.get(sub[3], sub[3])
			num = lang_dict.get(caption, 0)
			lang_dict[caption] = num + 1
			if num:
				caption += '-%d' % num
			sid = sub[2]
			self.actions_dict[sid] = dict(handler=self.substreams, caption=caption, checked=sub[1], pos=i, args=(self.menu, sid), kwargs=dict())

	def substreams(self, player, sid):
		self._update_checked(sid)
		player.set_audio_substream(sid)
		self.menu._set_options_list(keep_selection=True)



def get_audio_substreams(context):
	player = context['menu']
	return player.get_audio_substreams()

def set_audio_substream(key, value, aid, player):
	player.set_audio_substream(aid)

def set_repeat_mode(player, mode):
	if mode == 'off':
		pass
	player.repeat_mode = mode

def set_random_mode(player, mode):
	player.go_random()

class RepeatAudioActionItem(ActionContainer):
	def __init__(self, player, *args, **args):
		ActionContainer.__init__(self, *args, **kw)
		self.player = player
		self.radio = True
		if not self.player.repeat_mode:
			sel = (True, False, False)
		else:
			if self.player.repeat_mode == 'track':
				sel = (False, True, False)
			else:
				if self.player.repeat_mode == 'all':
					sel = (False, False, True)
		self.actions_dict = {'off': {'handler': self.set_repeat, 'caption': _('OFF'), 'checked': sel[0], 'args': ('off',), 'kwargs': {}, 'pos': 1}, 'track': {'handler': self.set_repeat, 'caption': _('Track'), 'checked': sel[1], 'args': ('track',), 'kwargs': {}, 'pos': 2}, 'all': {'handler': self.set_repeat, 'caption': _('All'), 'checked': sel[2], 'args': ('all',), 'kwargs': {}, 'pos': 3}}

	def set_repeat(self, mode):
		set_repeat_mode(self.player, mode)
		self._update_checked(mode)
		self.menu._set_options_list(keep_selection=True)



class RandomModeActionItem(ActionContainer):
	def __init__(self, player, *args, **args):
		ActionContainer.__init__(self, *args, **kw)
		self.radio = True
		self.player = player
		if self.player.random_mode:
			pass
		sel = (True, False)
		self.actions_dict = {'off': {'handler': self.set_random, 'caption': _('OFF'), 'checked': sel[0], 'args': ('off',), 'kwargs': {}, 'pos': 1}, 'on': {'handler': self.set_random, 'caption': _('ON'), 'checked': sel[1], 'args': ('on',), 'kwargs': {}, 'pos': 2}}

	def set_random(self, mode):
		set_random_mode(self.player, mode)
		self._update_checked(mode)
		self.menu._set_options_list(keep_selection=True)



class RepeatVideoActionItem(RepeatAudioActionItem):
	def __init__(self, player, *args, **args):
		RepeatAudioActionItem.__init__(self, player, *args, **kw)
		self.actions_dict.pop('track')
		self.actions_dict.pop('all')
		_is_not_repeat = self.actions_dict['off']['checked']
		self.actions_dict['on'] = {'handler': self.set_repeat, 'caption': _('ON'), 'checked': not _is_not_repeat, 'args': ('dummy',), 'kwargs': {}, 'pos': 2}

	def set_repeat(self, mode):
		if mode != 'off':
			pass
		_mode = mode
		set_repeat_mode(self.player, _mode)
		if mode == 'dummy':
			pass
		key = mode
		self._update_checked(key)
		self.menu._set_options_list(keep_selection=True)



class PlayModeVideoActionItem(ActionContainer):
	def __init__(self, player, *args, **args):
		ActionContainer.__init__(self, *args, **kw)
		self.player = player
		self.radio = True
		if self.player.playmode == 'track':
			pass
		sel = (False, True)
		self.actions_dict = {'track': {'handler': self.set_play_mode, 'caption': _('One'), 'checked': sel[0], 'args': ('track',), 'kwargs': {}, 'pos': 1}, 'all': {'handler': self.set_play_mode, 'caption': _('List'), 'checked': sel[1], 'args': ('all',), 'kwargs': {}, 'pos': 2}}

	def set_play_mode(self, mode):
		if self.player.repeat_mode:
			self.player.repeat_mode = mode
		set_play_mode(self.player, mode)
		self._update_checked(mode)
		self.menu._set_options_list(keep_selection=True)



def set_play_mode(player, mode):
	player.playmode = mode

def play_embedded_audio(context):
	context['selected'].play_embedded_audio()

def play_embedded_video(context):
	context['selected'].play_embedded_video()

def play_embedded_image(context):
	context['selected'].play_embedded_image()

]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76b3a2c>}
from __future__ import absolute_import
from pygui.config import HMI_PHOTO, user_config
from pygui.facilities.codemapping import country_dict, audio_codec_substitution_dict
from pygui.item.containers import ActionContainer
def go_aspect(context, display, aspect_corrected_mode):
	if 'selected' in context and context['selected']:
		context['selected'].show_menu()

class TransitionsActionItem(ActionContainer):
	def __init__(self, item, menu, name, **kw):
		self.item = item
		self.actions_dict = dict()
		ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)
		self.radio = True
		from pygui.facilities.codemapping import transition_dict
		for trans in HMI_PHOTO['transitions']:
			caption = '%s' % transition_dict.get(trans, trans)
			self.actions_dict[trans] = dict(handler=self.transitions, caption=caption, checked=user_config['photo']['transition'] == trans, args=(trans,), kwargs=dict())

	def transitions(self, trans):
		self._update_checked(trans)
		user_config['photo']['transition'] = trans
		user_config.save()
		self.menu._set_options_list(keep_selection=True)



def get_travelling(context):
	return []

def set_travelling(key, value):
	pass

class AspectRatioActionItem(ActionContainer):
	__doc__ = "Used to set the user's TV's aspect ratio (is it 4:3 or 16:9?).\n\n    Note that this is a player setting, not a per-item one.\n    "
	def __init__(self, menu, name, **kw):
		self.player = menu
		current_ratio = menu.aspect_ratio
		self.actions_dict = {'4_3': {'handler': self.set_aspect_ratio, 'caption': _('4:3'), 'checked': current_ratio == '4_3', 'args': ('4_3',), 'kwargs': {}}, '16_9': {'handler': self.set_aspect_ratio, 'caption': _('16:9'), 'checked': current_ratio == '16_9', 'args': ('16_9',), 'kwargs': {}}}
		self.radio = True
		ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)

	def set_aspect_ratio(self, aspect_ratio):
		self._update_checked(aspect_ratio)
		self.player.aspect_ratio = aspect_ratio
		self.menu._set_options_list(keep_selection=True)



class DisplayFormatActionItem(ActionContainer):
	__doc__ = "Used to set the display format when the TV's aspect ratio does not\n    match that of the video stream (e.g. 16:9 video on a 4:3 display).\n\n    See http://wiki.wyplay.int/doku.php/wybox:soft:multimedia:output_control\n    for a definition of what each setting does depending on the currently-\n    selected aspect ratio.\n    "
	def __init__(self, menu, name, **kw):
		self.player = menu
		current_format = menu.display_format
		values = [('letter_box', _('Original')), ('pan_scan', _('Full screen')), ('fullscreen', _('Cinema'))]
		actions_dict = {}
		for key, caption in values:
			action = {'handler': self.set_display_format, 'caption': caption, 'checked': current_format == key, 'args': (key,), 'kwargs': {}}
			actions_dict[key] = action
		self.actions_dict = actions_dict
		self.radio = True
		ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)

	def set_display_format(self, display_format):
		self._update_checked(display_format)
		self.player.display_format, user_config['video']['display_format'] = display_format, display_format
		user_config.save()
		self.menu._set_options_list(keep_selection=True)



class SubtitlesActionItem(ActionContainer):
	def __init__(self, item, menu, name, **kw):
		self.item = item
		self.actions_dict = dict()
		ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)
		self.radio = True
		lang_dict = {}
		for sub in self.menu.get_subtitles():
			try:
				caption = _(country_dict[sub[0][:2]]['language'])
			except KeyError:
				caption = _(sub[0])
			try:
				nb = lang_dict[caption]
				lang_dict[caption] = nb + 1
				caption = '%s-%.2d' % (caption, nb)
			except KeyError:
				lang_dict[caption] = 2
			sid = sub[2]
			self.actions_dict[sid] = dict(handler=self.subtitles, caption=caption, checked=sub[1], args=(self.menu, sid), kwargs=dict(), pos=sid + 1)

	def subtitles(self, player, sid):
		self._update_checked(sid)
		player.set_subtitle(sid)
		self.menu._set_options_list(keep_selection=True)



class AudioSubstreamsActionItem(ActionContainer):
	def __init__(self, item, menu, name, **kw):
		self.item = item
		self.actions_dict = dict()
		ActionContainer.__init__(self, name=name, type_='action', menu=menu, **kw)
		self.radio = True
		lang_dict = {}
		for i, sub in enumerate(self.menu.get_audio_substreams()):
			lang = sub[0]
			try:
				caption = _(country_dict[lang[:2]]['language'])
			except KeyError:
				caption = lang
			if len(sub) > 3 and sub[3] not in ('mp2',):
				caption += '-' + audio_codec_substitution_dict.get(sub[3], sub[3])
			num = lang_dict.get(caption, 0)
			lang_dict[caption] = num + 1
			if num:
				caption += '-%d' % num
			sid = sub[2]
			self.actions_dict[sid] = dict(handler=self.substreams, caption=caption, checked=sub[1], pos=i, args=(self.menu, sid), kwargs=dict())

	def substreams(self, player, sid):
		self._update_checked(sid)
		player.set_audio_substream(sid)
		self.menu._set_options_list(keep_selection=True)



def get_audio_substreams(context):
	player = context['menu']
	return player.get_audio_substreams()

def set_audio_substream(key, value, aid, player):
	player.set_audio_substream(aid)

def set_repeat_mode(player, mode):
	if mode == 'off':
		pass
	player.repeat_mode = mode

def set_random_mode(player, mode):
	player.go_random()

class RepeatAudioActionItem(ActionContainer):
	def __init__(self, player, *args, **args):
		ActionContainer.__init__(self, *args, **kw)
		self.player = player
		self.radio = True
		if not self.player.repeat_mode:
			sel = (True, False, False)
		else:
			if self.player.repeat_mode == 'track':
				sel = (False, True, False)
			else:
				if self.player.repeat_mode == 'all':
					sel = (False, False, True)
		self.actions_dict = {'off': {'handler': self.set_repeat, 'caption': _('OFF'), 'checked': sel[0], 'args': ('off',), 'kwargs': {}, 'pos': 1}, 'track': {'handler': self.set_repeat, 'caption': _('Track'), 'checked': sel[1], 'args': ('track',), 'kwargs': {}, 'pos': 2}, 'all': {'handler': self.set_repeat, 'caption': _('All'), 'checked': sel[2], 'args': ('all',), 'kwargs': {}, 'pos': 3}}

	def set_repeat(self, mode):
		set_repeat_mode(self.player, mode)
		self._update_checked(mode)
		self.menu._set_options_list(keep_selection=True)



class RandomModeActionItem(ActionContainer):
	def __init__(self, player, *args, **args):
		ActionContainer.__init__(self, *args, **kw)
		self.radio = True
		self.player = player
		if self.player.random_mode:
			pass
		sel = (True, False)
		self.actions_dict = {'off': {'handler': self.set_random, 'caption': _('OFF'), 'checked': sel[0], 'args': ('off',), 'kwargs': {}, 'pos': 1}, 'on': {'handler': self.set_random, 'caption': _('ON'), 'checked': sel[1], 'args': ('on',), 'kwargs': {}, 'pos': 2}}

	def set_random(self, mode):
		set_random_mode(self.player, mode)
		self._update_checked(mode)
		self.menu._set_options_list(keep_selection=True)



class RepeatVideoActionItem(RepeatAudioActionItem):
	def __init__(self, player, *args, **args):
		RepeatAudioActionItem.__init__(self, player, *args, **kw)
		self.actions_dict.pop('track')
		self.actions_dict.pop('all')
		_is_not_repeat = self.actions_dict['off']['checked']
		self.actions_dict['on'] = {'handler': self.set_repeat, 'caption': _('ON'), 'checked': not _is_not_repeat, 'args': ('dummy',), 'kwargs': {}, 'pos': 2}

	def set_repeat(self, mode):
		if mode != 'off':
			pass
		_mode = mode
		set_repeat_mode(self.player, _mode)
		if mode == 'dummy':
			pass
		key = mode
		self._update_checked(key)
		self.menu._set_options_list(keep_selection=True)



class PlayModeVideoActionItem(ActionContainer):
	def __init__(self, player, *args, **args):
		ActionContainer.__init__(self, *args, **kw)
		self.player = player
		self.radio = True
		if self.player.playmode == 'track':
			pass
		sel = (False, True)
		self.actions_dict = {'track': {'handler': self.set_play_mode, 'caption': _('One'), 'checked': sel[0], 'args': ('track',), 'kwargs': {}, 'pos': 1}, 'all': {'handler': self.set_play_mode, 'caption': _('List'), 'checked': sel[1], 'args': ('all',), 'kwargs': {}, 'pos': 2}}

	def set_play_mode(self, mode):
		if self.player.repeat_mode:
			self.player.repeat_mode = mode
		set_play_mode(self.player, mode)
		self._update_checked(mode)
		self.menu._set_options_list(keep_selection=True)



def set_play_mode(player, mode):
	player.playmode = mode

def play_embedded_audio(context):
	context['selected'].play_embedded_audio()

def play_embedded_video(context):
	context['selected'].play_embedded_video()

def play_embedded_image(context):
	context['selected'].play_embedded_image()

